package com.itboy.weixin.controller;


import com.itboy.common.core.domain.AjaxResult;
import com.itboy.common.core.page.TableDataInfo;
import com.itboy.weixin.bo.WxPublicUserQueryBo;
import com.itboy.weixin.domain.WxPublicUser;
import com.itboy.weixin.servcie.WxPublicUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/weixin/wxPublicUser")
public class WxPublicUserController {

	@Autowired
	private WxPublicUserService wxPublicUserService;

	/**
	 * 分页查询
	 * @param wxPublicUserQueryBo
	 * @return
	 */
	@GetMapping("/list")
	public TableDataInfo<WxPublicUser> queryPageList(WxPublicUserQueryBo wxPublicUserQueryBo){
		return wxPublicUserService.queryPageList(wxPublicUserQueryBo);
	}

	/**
	 * 同步微信公众号用户
	 */
	@GetMapping("/syncWxPublicUser")
	public AjaxResult syncWxPublicUser(){
		wxPublicUserService.syncWxPublicUser();
		return AjaxResult.success();
	}
}
